package paidaxing.blog.user.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

// dto/UserRequest.java (添加字段)
/**
 * 用户注册dto类
 *
 * @author heefM
 * @date 2025-10-18
 */
@Data
public class UserRequest {
    // 新增用户专用字段
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{4,20}$", message = "用户名格式不正确")
    private String username;
    
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^.{6,20}$", message = "密码长度6-20位")
    private String password;
    
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;
    
    @NotBlank(message = "昵称不能为空")
    private String nickname;
    
    // 可选字段
    private String avatar; //头像
    private String bio;   //个人简介
    private String website; //个人网站
    private String role = "USER"; // 默认角色
}